using FireStarterModeller.BO;

namespace FireStarterModeller.Test.BO
{
    public class TestUtilsUIControlType
    {
        /// <summary>
        /// Creates a new saved UIControlType with a random value assigned to every property
        /// </summary>
        public static UIControlType CreateSavedUIControlType()
        {
            UIControlType uIControlType = CreateUnsavedValidUIControlType();
            uIControlType.Save();
            return uIControlType;
        }

        /// <summary>
        /// Creates a new unsaved UIControlType with a random value assigned to every property
        /// </summary>
        public static UIControlType CreateUnsavedValidUIControlType()
        {
            UIControlType uIControlType = new UIControlType();
            uIControlType.AssemblyName = TestUtilsShared.GetRandomString();
            uIControlType.TypeName = TestUtilsShared.GetRandomString();
            uIControlType.SolutionID = TestUtilsShared.CreateSavedDMSolution().SolutionID;
            return uIControlType;
        }

        /// <summary>
        /// Creates a new unsaved UIControlType where all properties are null, except ID properties
        /// and those with default values.  If there are compulsory properties without
        /// defaults, saving the object will throw an exception.
        /// </summary>
        public static UIControlType CreateUnsavedDefaultUIControlType()
        {
            UIControlType uIControlType = new UIControlType();
            return uIControlType;
        }
    }
}